package com.power.sifa.correction.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.Repository;
import org.springframework.data.repository.query.Param;
import com.power.sifa.correction.model.Crc_geopoint;

import javax.transaction.Transactional;
import java.io.Serializable;
import java.util.List;

/**
 * 地图范围坐标 持久层(hibernate)
 */

public interface Crc_geopointDao extends JpaRepository<Crc_geopoint, Serializable>, JpaSpecificationExecutor<Crc_geopoint>, Repository<Crc_geopoint, Serializable>, Crc_geopointDaoCustom<Crc_geopoint, Serializable> {

   @Modifying
   @Transactional
   @Query("delete  from Crc_geopoint s where  s.id in (:ids) ")
   void removeByIds(@Param("ids") List<Integer> ids);

   @Query(" from Crc_geopoint s where s.id in (:ids) ")
   List<Crc_geopoint> getByIds(@Param("ids") List<String> ids);

   @Query(" from Crc_geopoint s where s.name = :name ")
   List<Crc_geopoint> findByName(@Param("name") String name);
}
